package com.wjq.gateway.web;


import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class MessageController {

    @Autowired
    RabbitTemplate rabbitTemplate;

    @RequestMapping("message")
    public String message(String mobile){
        rabbitTemplate.convertAndSend("message",mobile);
        log.info("准备进入rabbitHandler进行监听");
        return "发送成功";
    }

}
